package com.shimao.celnet.payment.test;

import java.util.Random;

/**
 * Created by XSW on 2018/10/30.
 */
public class StringRandom {
    public static void main(String[] args) {
        /*String guid = "147945fe-dc17-11e8-84ff-005056ac6816";
        String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        sb.append(guid);
        for(int i=0;i<5;i++){
            int number=random.nextInt(62);
            sb.append(str.charAt(number));
        }
        System.out.println(sb.toString());
        sb.substring(0,sb.length()-5);
        System.out.println(sb.substring(0,sb.length()-5));*/

        String code = "147945";

        StringBuilder res = new StringBuilder();

        Random random = new Random();
        int i = 0;
        while (i < 5) {
            res.append(random.nextInt(10));
            i++;
        }
        res.append(code);
        System.out.println(res.toString());
        res.substring(5);
        System.out.println( res.substring(5));
    }
}
